package practice05;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice05
 * @ClassName: Cuboid
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/10 10:12
 * @Copyright 大牛版板所有
 */
public class Cuboid extends Rectangle {
    private double high;

    public Cuboid() {
    }

    public Cuboid(double length, double width, double high) {
        super(length, width);
        this.high = high;
    }

    public double getHigh() {
        return high;
    }

    public void setHigh(double high) {
        this.high = high;
    }

    double s;
    double v;
    @Override
    public void area(){
        s = this.getLength()*this.getWidth();
        System.out.println("长方体的底面积为："+s);
    }

    public void volume(){
        v = s*this.getHigh();
        System.out.println("长方体的体积为："+v);
    }

}
